import request from '@/utils/request.ts';
import { ResponseData } from './type.ts';

enum API {
  IMG_UPLOAD = '/admin/product/fileUpload'
}

interface ImgUploadRes extends ResponseData {
  data: string;
}

// 图片上传接口
export const reqImgUpload = (data: FormData) =>
  request.post<any, ImgUploadRes>(API.IMG_UPLOAD, data, {
    headers: { 'Content-Type': 'multipart/form-data' }
  });
